package com.ygqh.baby.model;

import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

/**
 * Web用户操作日志实体
 *
 * @author: sunshuo
 * @date: 2018/11/27 14:52
 */
@Document(collection = "WEB_LOGGER")
public class WebLogger implements Serializable {

	private static final long serialVersionUID = -702418307641700457L;

	/**
	 * 编号
	 */
	private String id;

	/**
	 * 记录人员id
	 */
	private Long userId;

	/**
	 * 操作人用户名
	 */
	private String userName;

	/**
	 * 操作人名称
	 */
	private String operator;

	/**
	 * 自定义标题
	 */
	private String title;

	/**
	 * 客户端请求ip
	 */
	private String clientIp;

	/**
	 * 客户端请求路径
	 */
	private String uri;

	/**
	 * 终端请求方式,普通请求,ajax请求
	 */
	private String type;

	/**
	 * 请求方式method,post,get等
	 */
	private String method;

	/**
	 * 请求的类及方法
	 */
	private String classMethod;

	/**
	 * 请求参数内容,json
	 */
	private String paramData;

	/**
	 * 请求接口唯一session标识
	 */
	private String sessionId;

	/**
	 * 请求时间
	 */
	private Long requestTime;

	/**
	 * 接口返回时间
	 */
	private Long returnTime;

	/**
	 * 接口返回数据json
	 */
	private String returnData;

	/**
	 * 请求时httpStatusCode代码，如：200,400,404等
	 */
	private String httpStatusCode;

	/**
	 * 请求耗时秒单位
	 */
	private Long timeConsuming;

	/**
	 * 异常描述
	 */
	private String exceptionMessage;

	/**
	 * 请求开始时间
	 */
	private Long startTime;

	/**
	 * 请求结束时间
	 */
	private Long endTime;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getClientIp() {
		return clientIp;
	}

	public void setClientIp(String clientIp) {
		this.clientIp = clientIp;
	}

	public String getUri() {
		return uri;
	}

	public void setUri(String uri) {
		this.uri = uri;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public String getClassMethod() {
		return classMethod;
	}

	public void setClassMethod(String classMethod) {
		this.classMethod = classMethod;
	}

	public String getParamData() {
		return paramData;
	}

	public void setParamData(String paramData) {
		this.paramData = paramData;
	}

	public String getSessionId() {
		return sessionId;
	}

	public void setSessionId(String sessionId) {
		this.sessionId = sessionId;
	}

	public String getReturnData() {
		return returnData;
	}

	public void setReturnData(String returnData) {
		this.returnData = returnData;
	}

	public String getHttpStatusCode() {
		return httpStatusCode;
	}

	public void setHttpStatusCode(String httpStatusCode) {
		this.httpStatusCode = httpStatusCode;
	}

	public String getExceptionMessage() {
		return exceptionMessage;
	}

	public void setExceptionMessage(String exceptionMessage) {
		this.exceptionMessage = exceptionMessage;
	}

	public Long getStartTime() {
		return startTime;
	}

	public Long getEndTime() {
		return endTime;
	}

	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Long getRequestTime() {
		return requestTime;
	}

	public void setRequestTime(Long requestTime) {
		this.requestTime = requestTime;
	}

	public Long getReturnTime() {
		return returnTime;
	}

	public void setReturnTime(Long returnTime) {
		this.returnTime = returnTime;
	}

	public Long getTimeConsuming() {
		return timeConsuming;
	}

	public void setTimeConsuming(Long timeConsuming) {
		this.timeConsuming = timeConsuming;
	}

	public void setStartTime(Long startTime) {
		this.startTime = startTime;
	}

	public void setEndTime(Long endTime) {
		this.endTime = endTime;
	}

	@Override
	public String toString() {
		return "WebLogger{" +
				"id=" + id +
				", userId='" + userId + '\'' +
				", userName='" + userName + '\'' +
				", operator='" + operator + '\'' +
				", title='" + title + '\'' +
				", clientIp='" + clientIp + '\'' +
				", uri='" + uri + '\'' +
				", type='" + type + '\'' +
				", method='" + method + '\'' +
				", classMethod='" + classMethod + '\'' +
				", paramData='" + paramData + '\'' +
				", sessionId='" + sessionId + '\'' +
				", requestTime=" + requestTime +
				", returnTime='" + returnTime + '\'' +
				", returnData='" + returnData + '\'' +
				", httpStatusCode='" + httpStatusCode + '\'' +
				", timeConsuming=" + timeConsuming +
				", exceptionMessage='" + exceptionMessage + '\'' +
				", startTime=" + startTime +
				", endTime=" + endTime +
				'}';
	}
}
